from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app




def main():
    from jettube.server.services import users, webpage, comments, stations, opinions, songs
    
    application = webapp.WSGIApplication( [( '/addrecommendedsong.*', songs.AddRecommendedSong ),
                                           ( '/relatedsongs.*', songs.SimilarSongsHandler ),
                                           ( '/stationrequestdecision.*', users.RequestedStationDecisionHandler ),
                                           ( '/requestedstations.*', users.RequestedStationsHandler ),
                                           ( '/invitefriendstostation.*', stations.InviteFriendsToStationHandler ),
                                           ( '/registernewstation.*', stations.RegisterNewStationHandler ),
                                           ( '/extensionregister.*', users.ExtensionRegisterHandler ),
                                           ( '/getextensioninfo.*', users.ChromeExtensionRegisterUser ),
                                           ( '/googleregister.*', users.GoogleRegister ),
                                           ( '/registeruser.*', users.RegisterUserHandler ),
                                           ( '/whatis.*', webpage.WhatIsPage ),
                                           ( '/newstation.*', webpage.NewStationPage ),
                                           ( '/postcomment.*', comments.PostComment ),
                                           ( '/getstationnames.*', stations.StationNamesHandler ),
                                           ( '/getcomments.*', comments.GetComments ),
                                           ( '/addopinion.*', opinions.AddOpinionHandler ),
                                           ( '/getsongids.*', songs.GetSongsHandler ),
                                           ( '/addsong.*', songs.NewSongHandler ),
                                           ( '/', webpage.MainPage )], debug = True )
    run_wsgi_app( application )

def starrify(url):
    return url + '.*'

if __name__ == "__main__":
    main()
